<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNodesTable extends Migration
{
    /**
     * 权限表   节点表
     */
    public function up()
    {
        Schema::create('nodes', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 50)->comment('节点ID');
            $table->string('router_name', 100)->default('')->comment('路由别名,权限认证标识  admin.user.index');
            $table->unsignedInteger('pid')->default(0)->comment('父ID');
            $table->enum('is_menu', ['0', '1'])->default('0')->comment('是否为菜单:0否 1是');

            $table->timestamps();
            // 软删除
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nodes');
    }
}
